namespace Deepcode.QueryPatterns.Redux.Domain
{
	public class CustomerAddress
	{
		public virtual Customer Customer { get; set; }
		public virtual AddressType Type { get; set; }
		public virtual Address Address { get; set; }

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(null, obj)) return false;
			if (ReferenceEquals(this, obj)) return true;
			if (obj.GetType() != typeof (CustomerAddress)) return false;
			return Equals((CustomerAddress) obj);
		}

		public virtual bool Equals(CustomerAddress other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return Equals(other.Customer, Customer) && Equals(other.Type, Type) && Equals(other.Address, Address);
		}

		public override int GetHashCode()
		{
			unchecked
			{
				int result = (Customer != null ? Customer.GetHashCode() : 0);
				result = (result*397) ^ (Type != null ? Type.GetHashCode() : 0);
				result = (result*397) ^ (Address != null ? Address.GetHashCode() : 0);
				return result;
			}
		}
	}
}